package 力扣日常刷题.木22一月.第17天0129;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 帅小伙
 * @date 2022/1/29
 * @description
 */
public class Demo31简单数组拥有最多糖果的孩子 {


    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = 0;
        for (int candy : candies) {
            max = Math.max(max,candy);
        }
        ArrayList<Boolean> ans = new ArrayList<>();
        for (int candy : candies) {
            if(candy+extraCandies >= max) ans.add(true);
            else ans.add(false);
        }
        return ans;
    }

}
